package com.tobie.info.controller;

import com.tobie.info.entity.HotelEntity;
import com.tobie.info.service.IHotelService;
import com.tobie.info.util.ResultVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author lc
 * @Date 2023/11/17 16:52
 * @注释 酒店页面控制器
 */
@Slf4j
@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Resource
    private IHotelService hotelService;

    @GetMapping("/getAllHotel")
    public ResultVo<List<HotelEntity>> getAllHotel(){
        return ResultVo.success(hotelService.getAllHotel());
    }

    @GetMapping("/getHotelByPositionName/{positionName}")
    public ResultVo<List<HotelEntity>> getHotelByPositionName(@PathVariable("positionName") String positionName){
        return ResultVo.success(hotelService.getHotelByPositionName(positionName));
    }
}
